import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '@/views/Login/index.vue'
import Layout from '@/views/Layout/index.vue'
import Category from '@/views/Category/index.vue'

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/category/:id',
        component: Category
      }
    ]
  },
  {
    path: '/login',
    component: Login
  }
]
// 创建路由实例
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
